package com.example.Controller.User;

import com.example.Entity.Vo.APIResult;
import com.example.Entity.Vo.loginVo;
import com.example.IService.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/API/User")
@Api(tags = "用户信息控制器")
public class UserController {
    @Resource
    IUserService iUserService;

    /**
     * 用户登录
     * @param loginVo 实体
     * @return APIResult
     */
    @PostMapping("/Login")
    @ApiOperation("登录接口")
    public APIResult Login(@RequestBody loginVo loginVo){
        return iUserService.Login(loginVo);
    }

    /**
     * 检测用户是否登录
     * @return APIResult
     */
    @PostMapping("/CheckLogin")
    @ApiOperation("检测用户是否登录")
    public APIResult CheckLogin(){
        return iUserService.CheckLogin();
    }
}
